#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import random
logging.basicConfig(level=logging.INFO)
__author__='hubert'

#name = input('请输入:')
#print('hello',name)

# print("I'am ok")
# print('I\'am ok')
# print('I\'m \"OK\"!')
# print('中文字符')
#采用def定义函数
# def hello():
#     name = input("请输出:")
#     return 'hello ' + name
# print(hello())

#递归函数
def fact(n):
    if n==1:
        return 1
    return n * fact(n - 1)
#print(fact(5))

def get_ip():
    proxies = {}
    with open('../py1/douban/ip池.txt', 'r') as r:
        datas = r.readlines()
        # 利用random随机数，随机提取IP
        data = datas[random.randint(0,11)]
        key = data[:6].strip("'")
        value = data[7:].strip("'").strip('\n').rstrip("'")
        # 转换为字典
        proxies[key] = value
        r.close()
        return proxies

if __name__=='__main__':
    # logging.info('调用日志')
    # print(fact(6))
    num = 20
    for i in range(10):
        url = "http://douban.com?num=" + str(num)
        # print(url)
        num = num + 20
        # print(num)
    d = {}
    d["id"] = "1"
    d["pic"] = "http"
    # print(d)

    d1 = [1,2]
    print(len(d1))
